<?php

use yak\layui\helper\YakHelper;
use yii\helpers\Html;
use yak\layui\widgets\form\ActiveForm;

/* @var $this yii\web\View */
/* @var $model yak\layui\models\Menu */
/* @var $form yii\widgets\ActiveForm */
/* @var $ajaxOptions array */

?>

<div class="menu-form form-block">

    <?php $form = ActiveForm::begin([ 'ajaxOptions' => $ajaxOptions ]); ?>

    <?= $form->field($model, 'pid')->dropDownList(
        YakHelper::generateTreeByData($model->menuData([0, 1, 2])), [
        'lay-search' => true, 'prompt' => ['text' => '请选择/输入菜单项', 'options' => ['value' => 0]]
    ]) ?>

    <?php // $form->field($model, 'pos')->radioList(['1' => 'sSD', '2' => 'ASD']) ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => true, 'lay-verify' => 'required']) ?>

    <?= $form->field($model, 'href')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'icon')->widget(\yak\layui\widgets\form\IconPicker::class, ['type' => 0]) ?>

    <?= $form->field($model, 'active')->radioList(['0' => '否', '1' => '是']) ?>

    <?= $form->field($model, 'pos')->radioList($model->posLabels()) ?>

    <?= $form->field($model, 'type')->radioList($model->typeLabels()) ?>

    <?= $form->field($model, 'event')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'sort')->textInput() ?>

    <?= $form->field($model, 'status')->radioList(['0' => '否', '1' => '是']) ?>

    <div class="layui-form-item layui-input-block">
        <?= Html::submitButton('立即提交', [
            "class" => "layui-btn", "lay-submit" => true, "lay-filter" => "_SUBMIT_FORM"]) ?>
        <?= Html::resetButton('重置', [
            "class" => "layui-btn layui-btn-primary"
        ]) ?>
    </div>


    <?php ActiveForm::end(); ?>

</div>


